/*  
var pattern=/Box/ig;
var str='This is a Box！that is a Box';
alert(str.match(pattern));//Box,Box

var pattern=/Box/ig;//开启了全局
var str='This is a Box！that is a Box';
alert(str.match(pattern));//将所有匹配到的字符串组合成数组返回  Box,Box

var pattern=/Box/ig;//开启了全局
var str='This is a Box！that is a Box';
alert(str.search(pattern));//10 返回的第一个匹配的位置

var pattern=/Box/i;
var str='This is a Box！that is a Box';
alert(str.replace(pattern,'tom'));//返回替换后的字符串  This is a tom！that is a Box

var pattern=/Box/ig;//开启全局后，两个都被替换掉了
var str='This is a Box！that is a Box';
alert(str.replace(pattern,'tom'));//返回替换后的字符串  This is a tom！that is a tom

var pattern=/!/ig;//把字符串拆成数组
var str='This is a Box! that is a Box';
alert(str.split(pattern));//This is a Box, that is a Box

var pattern=/ /ig;//通过正则表达式把字符串拆成数组
var str='This is a Box! that is a Box';
alert(str.split(pattern));//This,is,a,Box!,that,is,a,Box

alert(RegExp.input);//啥都没有

var pattern=/(g)oogle/i;
var str='this is google!';
pattern.test(str);//必须执行一下，静态属性才有效
alert(RegExp['$_']);		//this is google!
alert(RegExp['$&']);		//google!
//alert(RegExp.input);//  this is google!
//alert(RegExp.leftContext);		//this is
//alert(RegExp.rightContext);		//!
//alert(RegExp.lastMatch);	//google
//alert(RegExp.lastParen);	//g

var pattern=/google/;
alert(pattern.global);//false

var pattern=/google/g;
alert(pattern.global);//true
*/

var pattern=/google/g;
alert(pattern.global);//true


















